home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / ACCESS.NL-NL / ACCLR.CAB / ADO210.CHM_0001_1043 / stylesheets / ado.js next >
Text File  |  2006-06-19  |  8KB  |  209 lines

  1. //.NET Enterprise Server Feedback
  2. //Version 1.1.
  3.  
  4. //*************************************************************************
  5. //***IMPORTANT: Enter your own feedback alias,                          ***
  6. //***            product version, and explanatory text here.            ***
  7. //***         (Localization section 1 of 3.)                ***
  8. //*************************************************************************
  9. var sFeedbackAlias = "mailto:adodoc@microsoft.com";
  10. var sProduct = "ado";
  11. var sProductVer = "2.7";
  12. var sDocVer = "0402";
  13.  
  14. var sTechSupportAbsoluteURL="";
  15. var sTechSupportFolder = "";
  16. var sTechSupportHTM = "psspsoverview.htm";
  17.     //(a)If the technical support topic is an external Web site,
  18.     //   put the URL in sTechSupportAbsoluteURL, and set the other variables to "".
  19.     //(b)If the technical support topic is in the same project as the current topic,
  20.     //   put the .htm filename in sTechSupportHTM, and set the other variables to "".
  21.     //(c)If the technical support topic is in a different project at the same level--
  22.     //   for example, in another project within a collection-- put the project name in
  23.     //   sTechSupportFolder, put the .htm filename in sTechSupportHTM, and set the other
  24.     //   variable to "". If there is a path from the project folder to the .htm folder,
  25.     //   include the path in sTechSupportHTM: "htm/techsupport.htm".
  26. if (sTechSupportAbsoluteURL != "") {sTechSupportHREF = sTechSupportAbsoluteURL;}
  27. else {sTechSupportHREF = buildTechSupport(sTechSupportFolder, sTechSupportHTM);}
  28.  
  29. var fbParagraph_Text = 'The MDAC documentation team cannot answer technical support questions, but welcomes your suggestions and comments about the documentation and samples. You can quickly and directly send e-mail feedback using the link below. All feedback must be in English. If you need technical support, see <A HREF=\"' + sTechSupportHREF + '\">Additional MDAC Resources</A>.';
  30. //*************************************************************************
  31. //***End: Localization section 1 of 3                    ***
  32. //***      (This is the only section modified for US version.)            ***
  33. //*************************************************************************
  34.  
  35.  
  36. function startFeedback(obj)
  37. {
  38. var stream;
  39. if(document.body.innerHTML.search(/fbRating/) != -1)  {fbReload();} 
  40.  
  41. var fbTitle_Text = 'Documentation Feedback';
  42.  
  43.  
  44. // ******Start: Localization Section 2 of 3*******************************
  45.  
  46. var fbRateThisTopic_Text = 'Rate this topic (1-5):';
  47. var fbPoor_Text = "Poor";
  48. var fbExcellent_Text = "Excellent";
  49. var fbEnterFeedbackHere_Text = 'To submit written feedback about this topic, click here:';
  50. var fbCancel_Text = 'Cancel';
  51.  
  52. // ******End: Localization Section 2 of 3*********************************
  53.  
  54.  
  55. stream = '<DIV ID="feedbackarea">'
  56.     + '<br>'
  57.     + '<hr COLOR="#99CCFF">'
  58.     + '<H6 STYLE="margin-top:0.5em;">' + fbTitle_Text + '</H6>'
  59.     + '<P>' + fbParagraph_Text + '</P>'
  60.     + '<FORM METHOD="post" ENCTYPE="text/plain" NAME="formRating">'
  61.     + '<P>' + fbRateThisTopic_Text + '    '
  62.     + fbPoor_Text + ' <INPUT TYPE="radio" value="1" NAME="fbRating">'
  63.     + '<INPUT TYPE="radio" value="2" NAME="fbRating">'
  64.     + '<INPUT TYPE="radio" value="3" NAME="fbRating">'
  65.     + '<INPUT TYPE="radio" value="4" NAME="fbRating">'
  66.     + '<INPUT TYPE="radio" value="5" NAME="fbRating"> ' + fbExcellent_Text + '</P>'
  67.     + '</FORM>'
  68.     + '<P>' + fbEnterFeedbackHere_Text + '    '
  69.     + '<SPAN ONCLICK="feedbackarea.style.display=\'none\';' + obj.id + '.innerHTML=\'\'">'+ submitFeedback() + '</SPAN></P>'
  70.     + '<P STYLE="width:97%;position:relative;float:left;clear:left;margin-bottom:-0.7em;margin-top:0em;" align=right><A HREF="#Feedback" ONCLICK=startFeedback(' + obj.id + ')>' + fbCancel_Text
  71.     + '</A> </P><BR>'
  72.     + '<hr COLOR="#99CCFF">'
  73.     + '</div>';
  74.  
  75. obj.innerHTML = stream;
  76. }
  77.  
  78.  
  79.  
  80. function submitFeedback()
  81. {
  82.  
  83. // *****Start: Localization Section 3 of 3********************************
  84.  
  85. var fbTypeHere_Text = 'Please type comments here, leaving the subject line in place.'
  86. var fbSubmit_Text = 'Submit feedback';
  87.  
  88. // ******End: Localization Section 3 of 3*********************************
  89.  
  90.  
  91.   //Build the subject line.
  92.   var sTitle = ParseTitle(document.title);
  93.   var sLocation = window.location.href.replace(/#Feedback/g,"");
  94.   var sLocation = sLocation.replace(/\/htm\//g,"\/");
  95.   var sLocation = sLocation.replace(/\/html\//g,"\/");
  96.   var sLocation = sLocation.replace(/.asp/g,".htm");
  97.   var delivType = checkDeliverable(sLocation);
  98.   var sURL = parseTheURL(sLocation, delivType);
  99.   var sLang = navigator.systemLanguage;
  100.   var sFBVer = "12";
  101.  
  102.   var sSubject =  sTitle + ' (' + "/1:" + sProduct + "/2:" + sProductVer + "/3:" + sDocVer + '/4:' + sURL + '/6:' + '\' +         GetRating() + \'/7:' + delivType + '/8:' + sLang +  '/9:' + sFBVer + ')'; 
  103.   var sEntireMailMessage = sFeedbackAlias + '?subject=' + sSubject 
  104.     + '&body=---' + fbTypeHere_Text + '---';
  105.   var sHREF = '<A HREF=\"' + sFeedbackAlias + '" ONCLICK=\"this.href=\''
  106.     + sEntireMailMessage + '\';\">' + fbSubmit_Text + '</A>';
  107.   return sHREF;
  108. }
  109.  
  110. //Checks deliverable type.
  111. function checkDeliverable(sLocation)
  112. {
  113.     if (sLocation.indexOf("ms-help://")!=-1) {return("h");}
  114.     if (sLocation.indexOf(".chm::/")!=-1) {return("c");}
  115.     if (sLocation.indexOf("http://")!=-1) {return("w");}
  116.     if (sLocation.indexOf("file:")!=-1) {return("f");}
  117.     return("0");
  118. }
  119.  
  120. //Parses URL.
  121. function parseTheURL(sLocation, delivType)
  122. {
  123.  
  124.     if ((delivType=="h") || (delivType=="w")|| (delivType=="f"))
  125.     {
  126.           var x = sLocation.lastIndexOf("/");
  127.         var a = sLocation.substr(0,x);
  128.         var b = a.lastIndexOf("/");
  129.         var c = a.substr(b + 1);
  130.  
  131.         sURL = c + "/5:" + sLocation.substr(x + 1) ;
  132.  
  133.           return(sURL);
  134.     }
  135.  
  136.     if (delivType=="c") 
  137.     {
  138.           var theLastSlash = sLocation.lastIndexOf("\\");
  139.           var theLen = sLocation.length;
  140.           sLocation = sLocation.substr(theLastSlash + 1, theLen  -           theLastSlash);
  141.           var x = sLocation.lastIndexOf("/");
  142.  
  143.         sURL = sLocation.substr(0, (x-6)) + "/" +             sLocation.substr(x + 1);
  144.  
  145.           return(sURL);
  146.  
  147.     }
  148.     return("unknown");
  149. }
  150.  
  151. //---Parses document title.---
  152. function ParseTitle(theTitle)
  153. {
  154.     theTitle = theTitle.replace(/\"/g,"--");
  155.       theTitle = theTitle.replace(/'/g,"-");
  156.     if (theTitle == "") {theTitle = "Documentation Feedback";}
  157.     if (theTitle.length > 50) {theTitle = theTitle.slice(0,47) + "...";}
  158.     return theTitle;
  159. }
  160.  
  161. //---Gets topic rating.---
  162. function GetRating()
  163. {
  164.     sRating = "0";
  165.     for(var x = 0;x < 5;x++)
  166.       {
  167.               if(document.formRating.fbRating(x).checked) {sRating = x + 1;}
  168.       }
  169.     return sRating;
  170. }
  171.  
  172. function buildTechSupport(sTechSupportFolder, sTechSupportHTM)
  173. {
  174.   var delivType = checkDeliverable(window.location.href);
  175.   var sTechSupportHREF="";
  176.   if (delivType=="c") 
  177.   {
  178.     if (sTechSupportFolder != "")
  179.     {
  180.         sTechSupportHREF = sTechSupportFolder + ".chm::/";
  181.     }
  182.     sTechSupportHREF += sTechSupportHTM;
  183.     return sTechSupportHREF;
  184.   }
  185.   else
  186.   {
  187.     if (sTechSupportFolder != "")
  188.     {
  189.         sTechSupportHREF = "../" + sTechSupportFolder + "/";
  190.     }
  191.     sTechSupportHREF += sTechSupportHTM;
  192.     return sTechSupportHREF;
  193.   }
  194. }
  195.  
  196. //---Reloads window.---
  197. function fbReload()
  198. {
  199.     window.location.reload(true);
  200.  
  201. }
  202.  
  203. //
  204. //Enhancements over v1.0:
  205. //    -Deliverable-neutral URLs.
  206. //    -Autodetection of deliverable (one version for .chm, .hxs, and Web).
  207. //    -Product version information in subject line.
  208. //    -Feedback version information in subject line.
  209. //    -Deliverable type information in subject line.